package com.zy.web.demo.duoxiancheng.demo12;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/4 15:42
 */
public class Main12 {

    private String user;
    private String password;
//    private String zy = new String();

    public void test(String users,String passwords){
        try {
            String zy = new String();
            synchronized (zy){

                user = users;
                System.out.println("name ="+Thread.currentThread().getName()+" ,time="+System.currentTimeMillis());
                Thread.sleep(1000);
                System.out.println("name ="+Thread.currentThread().getName()+" ,time="+System.currentTimeMillis());

            }
        }catch (InterruptedException e){
            e.printStackTrace();
        }
    }


}
